package cn.iocoder.yudao.module.bpm.dal.mysql.projectinfo;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.bpm.dal.dataobject.projectinfo.BpmProjectInfoDO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.taskinfo.BpmTaskInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.bpm.controller.admin.projectinfo.vo.*;

/**
 * 流程项目信息 Mapper
 *
 * @author 韩佳乐
 */
@Mapper
public interface BpmProjectInfoMapper extends BaseMapperX<BpmProjectInfoDO> {

    default PageResult<BpmProjectInfoDO> selectPage(BpmProjectInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BpmProjectInfoDO>()
                .likeIfPresent(BpmProjectInfoDO::getName, reqVO.getName())
                .eqIfPresent(BpmProjectInfoDO::getAdminId, reqVO.getAdminId())
                .eqIfPresent(BpmProjectInfoDO::getDescription, reqVO.getDescription())
                .eqIfPresent(BpmProjectInfoDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(BpmProjectInfoDO::getStartTime, reqVO.getStartTime())
                .betweenIfPresent(BpmProjectInfoDO::getEndTime, reqVO.getEndTime())
                .eqIfPresent(BpmProjectInfoDO::getTagId, reqVO.getTagId())
                .eqIfPresent(BpmProjectInfoDO::getOrderRank, reqVO.getOrderRank())
                .eqIfPresent(BpmProjectInfoDO::getRemark, reqVO.getRemark())
//                .eqIfPresent(BpmProjectInfoDO::getCreator, reqVO.getCreator())
                .betweenIfPresent(BpmProjectInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BpmProjectInfoDO::getId));
    }

}